package com.quad.innovators.salesease.enums;

import com.quad.innovators.salesease.common.result.IResultCode;

import java.io.Serializable;


public enum ResultCode implements IResultCode, Serializable {
    SUCCESS(200, "成功"),
    NOT_FOUND(404, "未找到"),
    FORBID(403, "您没有权限访问当前资源"),
    NO_LOGIN(401, "您暂未登入"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),

    /** 参数异常 */
    PARAM_CHECK_ILLEGAL(501, "参数校验失败"),
    PARAMS_ERROR(502, "参数{}不正确"),
    PARAMS_MISSING(503, "参数丢失"),
    PARAMS_READABLE(504, "could_not_read_json"),
    PARAMS_BIND(505, "参数绑定失败"),
    PARAMS_CONSTRAINT(506, "参数不符合约束条件"),
    PARAMS_FORMAT(507, "参数格式化失败"),
    ID_VALUE_INVALID(508, "参数id的值非法"),
    VALID_STATUS(509, "无效的状态"),

    /** 请求异常 */
    REQUEST_NOT_ALLOW(510, "不支持当前请求方法"),
    UNSUPPORTED_MEDIA_TYPE(511, "不支持当前媒体类型"),
    USERNAME_OR_PASSWORD_ERROR(512, "用户名或密码错误"),
    LOGIN_CAPTCHA_ERROR(513, "验证码错误"),
    REPEAT_SUBMIT_ERROR(514, "您的请求已提交，请不要重复提交或等待片刻再尝试。"),
    ALREADY_EXISTS_ERROR(515, "您提交的数据已存在。"),
    COLLECTION_NOT_EMPTY(516, "请求数据列表不能为空"),
    UNRECEIVED_NOT_AUDIT(517, "未签收的单据不能审核"),
    TASK_OUT_TIME(517, "任务超过时间"),

    /** excel报错 */
    EXCEL_DATA_NOT_NULL(520, "excel存在数据空白"),
    EXCEL_PRODUCT_NOT_FOUNT(521, "产品不存在或已被禁用"),
    EXCEL_PRODUCT_NOT_PACKING(522, "同一个包装码的产品不同"),
    EXCEL_PACKING_NUMBER_NOT_PRODUCT(523, "导入产品码与包装数量不一致"),
    EXCEL_NUMBER_NOT_PRODUCT_NUMBER(524, "产品导入数量与进货数量不一致")
    ;
    private final int code;
    private final String msg;
    ;

    ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
